Primitive Class Time
Represents a time value in game frames, with support for formatting to hours, minutes, seconds, and centiseconds (1/100th of a second).
Members
h | (int) Hours component. |
m | (int) Minutes component. |
s | (int) Seconds component. |
c | (int) Centiseconds component. |
Functions
Time() | Create a Time object. |
Time(gameFrames) | Create a Time object from a total game frame count (1 second = 30 frames). |
Time(formattedTime) | Create a Time object from a formatted string. |
Time(timeUnits) | Create a Time object from a time unit table (hours, minutes, seconds, centiseconds). |
Time:GetFrameCount() | Get the total game frame count. |
Time:GetTimeUnits() | Get the time in hours, minutes, seconds, and centiseconds as a table. |
tostring(this) | Convert this Time object to a formatted string. |
Members
- h
- (int) Hours component.
- m
- (int) Minutes component.
- s
- (int) Seconds component.
- c
- (int) Centiseconds component.
Functions
- Time()
-
Create a Time object.
Returns:
-
Time
A new Time object initialized to zero time.
- Time(gameFrames)
-
Create a Time object from a total game frame count (1 second = 30 frames).
Parameters:
- gameFrames int Total game frame count.
Returns:
-
Time
A new Time object initialized with the given frame count.
- Time(formattedTime)
-
Create a Time object from a formatted string.
Parameters:
- formattedTime string Time in the format "HH:MM:SS[.CC]", where [.CC] is centiseconds and is optional.
Returns:
-
Time
A new Time object parsed from the given string.
- Time(timeUnits)
-
Create a Time object from a time unit table (hours, minutes, seconds, centiseconds).
Parameters:
- timeUnits table A time unit table in the format {HH, MM, SS, [CC]}, where [CC] is optional.
Returns:
-
Time
A new Time object initialized with the given values.
- Time:GetFrameCount()
-
Get the total game frame count.
Returns:
-
int
Total number of game frames.
- Time:GetTimeUnits()
-
Get the time in hours, minutes, seconds, and centiseconds as a table.
Returns:
-
table
A table in the format {HH, MM, SS, CC}.
- tostring(this)
-
Convert this Time object to a formatted string.
Parameters:
- this Time Time object.
Returns:
-
string
A string showing time in "HH:MM:SS.CC" format.